
export const getFile = (path:string)=>{
  window.electron.ipcRenderer.send('getFile',path)
}

export const setFile = (path:string,data:string)=>{
  window.electron.ipcRenderer.send('setFile',path,data)
}

export const getFileInvoke = (path:string)=>{
  return window.electron.ipcRenderer.invoke('getFile',path)
}

export const toTop = (status:boolean)=>{
  return window.electron.ipcRenderer.invoke('toTop',status);
}

export const openNewWindow = ()=>{
  return window.electron.ipcRenderer.invoke('openNewWindow');
}

export const openFileDirect = ()=>{
  return window.electron.ipcRenderer.invoke('openFileDirect');
}
export const openFile = ()=>{
  return window.electron.ipcRenderer.invoke('openFile');
}

/**
 * 获取配置文件
 * @param path
 */
export const getConfig = ()=> {
  // getFile('../../config/config.json');
  return getFileInvoke('../../config/config.json');
}

export const setConfig = (data:string)=>{
  setFile('../../config/config.json',data)
}
